<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div id="app">
        <!-- 文本插值，修改标签内容 -->
        <p>{{msg}}</p>
        <!-- 指令，修改标签属性 -->
        <p v-text="msgMax"></p>
        <p v-html="msgMax"></p>
        <hr>
        <p>v-for 循环数组</p>
        <button v-for="(item,i) in arr1" :key="i">{{i+1}}. {{item}}</button>
        <button v-for="(item,i) in arr1" :key="i+'aaa'">{{i+1}}. {{item}}</button>
        <!-- 在同一个父元素中，v-for循环的key值是唯一的，不能重复 -->
        <hr>
        <hr>
        <ul>
            <li v-for="(item,index) in arr2" :key="index">
                {{index + 1}}:name: {{item.name}}-price: {{item.price}}元-num: {{item.num}}件
            </li>
        </ul>
    </div>
    <script src="../0511/js/vue.js"></script>
    <script>
        let vm = new Vue({
            el: '#app',
            data: {
                msg: '下楼做核酸',
                msgMax: '<mark>下楼做核酸</mark>',
                arr1: [1,2,3,4,9],
                arr2: [
                    {name: 'iphone 13 ProMax', price: 8996, num: 1},
                    {name: 'HW P50', price: 8096, num: 2},
                    {name: 'Mi 12U', price: 4999, num: 9}
                ]
            }
        })
    </script>
</body>
</html>